import { CustomError, CustomErrorType } from '../customError';
import { reportError } from '../actions/error';

function loggerMiddleware({ dispatch, getState }) {
  return next => (action) => {
    if (typeof action === 'function') {
      console.log('dispatch a function action');
    } else {
      console.log('dispatching', action);
    }
    const result = next(action);
    console.log('next state', getState());
    return result;
  };
}
export default loggerMiddleware;
